import Router from "koa-router";
const router = Router({
  prefix: '/swagger'
})
/**
 * @swagger
 * /swagger/test:
 *   post:
 *     summary: 测试
 *     description: 测试
 *     tags:
 *       - swagger测试
 *     parameters:
 *       - name: test
 *         required: true
 *         description: 测试
 *       - name: test1
 *         required: false
 *         description: 测试1
 */
router.get('/test', async (ctx) => {
  const users = [
    { id: 1, name: 'John Doe', email: 'john.doe@example.com' },
    { id: 2, name: 'Jane Doe', email: 'jane.doe@example.com' },
  ];
  ctx.body = users;
});
// 获取博客列表
/**
 * @swagger
 * /swagger/test2:
 *   post:
 *     summary: 测试2
 *     description: 测试2
 *     tags:
 *       - swagger测试
 *     parameters:
 *       - name: test
 *         required: true
 *         description: 测试21
 *       - name: test1
 *         required: false
 *         description: 测试22
 */
router.get('/test2', async (ctx) => {
  const users = [
    { id: 1, name: 'John Doe', email: 'john.doe@example.com' },
    { id: 2, name: 'Jane Doe', email: 'jane.doe@example.com' },
  ];
  ctx.body = users;
});